<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style type="text/css">
        .gridtable {
            width: 900px;
            font-family: verdana, arial, sans-serif;
            font-size: 11px;
            color: #333333;
            border-width: 1px;
            border-color: #666666;
            border-collapse: collapse;
            text-align: center;
        }

        .gridtable th {
            border-width: 1px;
            padding: 8px;
            border-style: solid;
            border-color: #666666;
            background-color: #dedede;
        }

        .gridtable tr {
            height: 80px;
            border-width: 1px;
            padding: 8px;
            border-style: solid;
            border-color: #666666;
            background-color: #ffffff;
        }

        .gridtable td {
            border-width: 1px;
            padding: 8px;
            border-style: solid;
            border-color: #666666;
            background-color: #ffffff;
        }

        #red {
            background-color: red;
        }
    </style>
</head>

<body>
    <table width="500px" align="center" class="gridtable">
        <th>电影id</th>
        <th>电影名称</th>
        <th>电影评分</th>
    </table>
</body>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script>
    $.get("http://localhost:8080/getlist", function (data) {
        // console.log(data);
        var list = JSON.parse(data);
        console.log(list);
        for (var i = 0; i < list.length; i++) {
            var tr = document.createElement('tr');
            for (var j = 0; j < 3; j++) {
                var td = document.createElement('td');
                if (j == 0) {
                    td.innerHTML = list[i].movieId;
                } else if (j == 1) {
                    td.innerHTML = list[i].movieName;
                } else {
                    td.innerHTML = list[i].movieOrange;
                }
                tr.appendChild(td);
            }
            document.getElementsByClassName('gridtable')[0].appendChild(tr);
        }
    })
</script>

</html>